﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="buyer_systemRecipeList.aspx.cs"
    EnableEventValidation="false" Inherits="PeisongWeb.systemRecipeList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>系统菜谱</title>
    <!--#include file="/global.inc" -->
    <link href="/app_common/scripts/jqModal.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
    <style>
    .txtarea1{
        width:75px;
    }
    .txtarea2{
        width:220px;
    }
    </style>
    <![endif]-->
    <script src="/app_common/scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script src="/app_common/scripts/jqModal.js" type="text/javascript"></script>

    <script src="/app_common/scripts/QueryString.js" type="text/javascript"></script>

    <script src="/fromjs/recipe.js" type="text/javascript"></script>

    <script src="/fromjs/fillscreenFix.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="container">
        <uc1:headerV2 runat="server" ID="header1" />
        <div id="homemain">
            <div id="main">
                <div class="title">
                    <div class="title_text">
                        <ul>
                            <li class="color1">菜谱管理</li>
                            <li class="color2">-系统菜谱</li>
                        </ul>
                    </div>
                </div>
                <div class="line_top">
                </div>
                <div id="mainmiddle">
                    <div class="recipes_left">
                        <div class="recipes_title">
                            <span>系统菜谱类别</span>
                        </div>
                        <div class="recipes_list">
                            <ul id="systemRecipeCategoryList">
                                <asp:Repeater runat="server" ID="rptRecipeCategoryList">
                                    <ItemTemplate>
                                        <li><a href="?name=<%#HttpUtility.UrlEncodeUnicode(Eval("name").ToString()) %>&category=<%#Eval("rcid") %>">
                                            <%#Eval("name") %>(<%#Eval("RecipeCount")%>)</a></li>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </ul>
                        </div>
                    </div>
                    <div class="recipes_right">
                        <div style="padding-left: 20px; padding-top: 20px;">
                            <div class="recipes_right_title">
                                <span>
                                    <asp:Literal runat="server" ID="lblRecipeCategoryName"></asp:Literal>菜谱列表</span>
                            </div>
                            <div class="recipeslist">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr class="list_title">
                                        <td width="22%">
                                            菜谱名称
                                        </td>
                                        <td width="53%">
                                            菜谱材料
                                        </td>
                                        <td width="10%">
                                            查看
                                        </td>
                                        <td width="15%">
                                            加入我的菜谱
                                        </td>
                                    </tr>
                                </table>
                                <table border="0" cellspacing="0" cellpadding="0" class="recipeslist_border">
                                    <asp:Repeater runat="server" ID="rptRecipeList" OnItemCommand="rptRecipeList_ItemCommand">
                                        <ItemTemplate>
                                            <tr class='<%#Container.ItemIndex%2==0?"":"tr_color" %>'>
                                                <td width="22%" class="line">
                                                    <%#Eval("name") %><%#Eval("Flag").ToString()=="1"?"<img alt='' src='app_common/images/hot.jpg' />":"" %>
                                                </td>
                                                <td width="53%" class="line">
                                                    <%#Eval("ProductNames") %>
                                                </td>
                                                <td width="10%" class="line">
                                                    <a recipeid="<%#Eval("recipeId") %>" recipecategoryname='<%#Eval("RecipeCategoryName") %>'
                                                        class="jqModalView" href="javascript:void(0);">
                                                        <img alt="查看" src="/app_common/images/cha.gif" /></a>
                                                </td>
                                                <td width="15%">
                                                    <asp:ImageButton Enabled='<%#hasPermission("FC",2) %>'  AlternateText="加入我的菜谱" recipeName='<%#Eval("name") %>' CommandName="Add" CommandArgument='<%#Eval("recipeId") %>'
                                                        runat="server" OnClientClick="return setRecipeName(this);" ID="lblJoin" ImageUrl="/app_common/images/pic_1.gif" />
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </table>
                            </div>
                        </div>
                        <div class="page">
                            <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                                AlwaysShow="true" Width="98%" runat="server" PageSize="20" InvalidPageIndexErrorMessage="无效页码"
                                NumericButtonCount="5" PageIndexOutOfRangeErrorMessage="页码超出范围" ShowCustomInfoSection="Left"
                                CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 " CustomInfoTextAlign="Left"
                                HorizontalAlign="Right" OnPageChanged="AspNetPager1_PageChanged" NextPageText=">"
                                FirstPageText="<<首页" LastPageText="末页>>" PrevPageText="<" CssClass="paginator"
                                CurrentPageButtonClass="cpb">
                            </webdiyer:AspNetPager>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <uc1:footerV2 runat="server" ID="footer1" />
    </div>
    <div id="dvModelPanel" class="new_recipe jqmWindow">
        <div class="close"><img id="closeModalPanel" style="cursor: hand;" alt="关闭" src="/app_common/images/sc.gif" /></div>
        <div class="name_dish">
            <ul>
                <li>菜名：</li>
                <li><input id="txtDishName" runat="server" type="text" /></li>
                <li>菜谱分类：</li>
                <li>
                    <asp:DropDownList Width="155" runat="server" ID="ddlRecipeCategory" DataTextField="name" DataValueField="rcid"></asp:DropDownList>
                </li>
                <li><a href="javascript:void(0);" onclick="addNewProduct();" class="blue">添加新的材料</a></li>
            </ul>
        </div>
        <div class="div_txtarea_title">
            <div style="width: 240px; text-align: left; height: 26px;">已选食材：</div>
            <div class="div_txtarea">
                <ul id="recipeProducts">
                </ul>
            </div>
        </div>
        <div class="div_txtarea_line"></div>
        <div class="div_txtarea_sc" id="category_product_list" style="display:none;">
            <div style="float: left; width: 100px;">
                <div class="div_txtarea_text">
                    食材大类：</div>
                <div class="txtarea1">
                    <ul id="lstCategory">
                        <asp:Repeater runat="server" ID="rptCategory">
                            <ItemTemplate>
                                <li categoryid='<%#Eval("categoryId") %>'><%#Eval("name") %></li>
                            </ItemTemplate>
                        </asp:Repeater>
                    </ul>
                </div>
            </div>
            <div style="float: left; padding: 60px 10px 0 10px;">
                <img alt="" src="/app_common/images/index-1.gif" /></div>
            <div style="float: left; width: 100px;">
                <div class="div_txtarea_text">
                    食材小类：</div>
                <div class="txtarea1">
                    <ul id="lstSubCategory">
                    </ul>
                </div>
            </div>
            <div style="float: left; padding: 60px 10px 0 10px;">
                <img alt="" src="/app_common/images/index-1.gif" /></div>
            <div style="float: left; width: 240px;">
                <div style="text-align: left; width: 240px; line-height: 30px; vertical-align: middle;">
                    食材：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
                        class="STYLE1">（点击添加到已选食材）</span></div>
                <div class="txtarea2">
                    <ul id="lstProduct">
                    </ul>
                </div>
            </div>
        </div>
        <div class="save">
            <asp:Button CssClass="button_round8" runat="server" ID="btnSaveRecipe" OnClick="btnSaveRecipe_Click" OnClientClick="return beforeSave();" Text="保存为我的菜谱" />
        </div>
    </div>
    <asp:HiddenField runat="server" ID="hdCurrentRecipeId" />
    <asp:HiddenField runat="server" ID="hdCurrentRecipeName" />
    <asp:HiddenField runat="server" ID="hdProductIds" />
    </form>
</body>
</html>
